package net.zigin.nhi.could.waste.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import net.zigin.nhi.could.waste.service.WasteBaseRecordService;

import net.zigin.nhi.could.waste.vo.JsonForResult;
import net.zigin.nhi.could.waste.vo.WasteBaseRecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * WasteRecord控制器类
 * @ClassName: WasteRecordController
 * @author mgw1986
 * @date 2021-9-20 17:18:01
 * @version V1.0
 */
@Api(tags = "医废记录管理")
@RestController
@RequestMapping("/wasteRecord")
public class WasteRecordController extends BaseController {
	@Autowired
	private WasteBaseRecordService wasteBaseRecordService;

	@ApiOperation("医废记录列表")
	@ApiImplicitParam(name = "wasteBaseId", value = "医废id", required = true, dataType = "String")
	@GetMapping("/getListByWasteId/{wasteBaseId}")
	public JsonForResult<List<WasteBaseRecordVo>> getListByWasteId(@PathVariable String wasteBaseId){
		List<WasteBaseRecordVo> list = wasteBaseRecordService.getListByWasteId(wasteBaseId);
		return JsonForResult.<List<WasteBaseRecordVo>>builder().data(list).success(true).build();
	}

}
